﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo01
{
    class 结构
    {
        struct PersonStruct
        {
            public string name;
            public int phone;
            public string site;
        }
        class PersonClass
        {
            public string Name { get; set; }
            public int Phone { get; set; }
            public string Site { get; set; }
        }
        static void Main(string[] args)
        {
            PersonStruct per1 = new PersonStruct();
            per1.name = "张三";
            per1.phone = 10086;
            per1.site = "移动营业厅旁小黑屋";

            PersonStruct per2 = per1;
            per2.name = "李四";

            Console.WriteLine("我叫{0}，我的电话号码是：{1}，我住在{2}", per1.name, per1.phone, per1.site);

            PersonClass per3 = new PersonClass();
            per3.Name = "王五";
            per3.Phone = 119;
            per3.Site = "消防局旁小黑屋";

            PersonClass per4 = per3;
            per4.Name = "赵六";

            Console.WriteLine("我叫{0}，我的电话号码是：{1}，我住在{2}", per3.Name, per3.Phone, per3.Site);

            //结构体是独立的，类是会被改变的。
        }
    }
}
